﻿using mds.NoSqlDatabase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mds.Log
{
   public class LogCassandra
    {
        private static LogCassandra _instance = new LogCassandra();

        public static LogCassandra Instance
        {
            get { return _instance; }
            
        }
        private LogConfigItem _config;
        private LogCassandra()
        {
            _config = LogConfigService.Instance.GetConfig();
        }
        public void Log(String logContent,String applcationName,String ip)
        {
            CassandraProvider.Instance.AppendLog(logContent, applcationName, ip, _config.StorePath);
        }

        internal void LogError(string ApplicationName,DateTime CreateTime,string Host,string Id,string Ip,string Mac,string Message,DateTime ModifyTime,string Source,string SourceObject,int StatuCode,string Type)
        {
            CassandraProvider.Instance.AppendErrorLog(ApplicationName, CreateTime, Host, Id, Ip, Mac, Message, ModifyTime, Source, SourceObject, StatuCode, Type, _config.StorePath);
        }
    }
}
